# -*- coding: UTF-8 -*-


class Cell:
    x = 0
    y = 0
    width = 10
    height = 10

    def __init__(self, x, y, width=10, height=10):
        self.x = x
        self.y = y
        self.width = width
        self.height = height

    def __str__(self):
        return "{{x:{0.x}, y:{0.y}}}".format(self)

    def __cmp__(self, other):
        "比较大小，根据x|y由小到大排序"
        if self.x < other.x & self.y < other.y:
            return -1
        elif self.x == other.x & self.y == other.y:
            return 0
        elif self.x < other.x:
            return -1
        elif self.y < other.y:
            return -1
        else:
            return 1
